package com.chen.services;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.chen.dao.HibernateSessionFactory;
import com.chen.model.Eclass;

@SuppressWarnings("unchecked")
public class EclassServiceImpl implements EclassService {
	
	@Override
	@Transactional
	public List<Eclass> getEclass() throws Exception {
		List list = HibernateSessionFactory.currentSession().createSQLQuery("select classid,classname,payfactor from class").addEntity(Eclass.class).list();
		System.out.println("**************************"+list.size());
		
		for (int i = 0; i < list.size(); i++) {
			Eclass a = (Eclass)list.get(i);
			System.out.println(a.getClassID());
		}
		System.out.println();
		return list;
	}

}
